//
//  ZYCommentContentThreeCell.m
//  DDD
//
//  Created by Ethan on 2017/10/6.
//  Copyright © 2017年 乾坤. All rights reserved.
//

#import "ZYCommentContentThreeCell.h"
#import "ZYCommentContentThreeModel.h"
@implementation ZYCommentContentThreeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    return self;
}
- (void)assignByZYCommentContentThreeModel:(ZYCommentContentThreeModel *)model{
    
    self.contentLabel.text =  [NSString stringWithFormat:@"%@",model.content];
    
}
- (void)setUpSuperView{
    
    self.contentLabel = [UILabel new];
    self.contentLabel.textColor = ColorRGB(51, 51, 51);
    self.contentLabel.numberOfLines = 0;
    self.contentLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.contentLabel];
    
    self.updateButton  = [UIButton buttonWithType:(UIButtonTypeCustom)];
    
    [self.contentView addSubview:self.updateButton];
    
    self.deleteButton  = [UIButton buttonWithType:(UIButtonTypeCustom)];

    [self.contentView addSubview:self.deleteButton];
    
    
    [self.updateButton setImage:[UIImage imageNamed:@"icon_modification_default"] forState:(UIControlStateNormal)];
    
    [self.deleteButton setImage:[UIImage imageNamed:@"icon_delete_default"] forState:(UIControlStateNormal)];
    
    
    self.contentLabel.text = @"两个黄鹂鸣翠柳 一行白鹭上青天";
    
    
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(8);
        make.top.offset(8);
        make.right.equalTo(self).offset(-100);
        
    }];
    [self.updateButton mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.contentLabel.mas_right).offset(2);
        make.top.centerY.equalTo(self.contentLabel);
        make.width.height.offset(40);
    }];
    
    [self.deleteButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.updateButton.mas_right).offset(2);
        make.top.centerY.equalTo(self.updateButton);
        make.width.height.offset(40);
    }];
    
    UILabel *grayLabel = [UILabel new];
    grayLabel.backgroundColor =[UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:grayLabel];
    
    [grayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(0);
        make.top.equalTo(self.contentLabel.mas_bottom).offset(5);
        make.width.offset(kScreenWidth);
        make.height.offset(1);
    }];
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(grayLabel).offset(0);
    }];
    
    
    
}


@end
